package com.yueqian.exception;

import javax.swing.*;

public class Test3 {
    public static void main(String[] args) {
        String input = JOptionPane.showInputDialog("请输入数值");
        try {
            double d = Double.parseDouble(input);
            JOptionPane.showMessageDialog(null, d);
        } catch (NumberFormatException e) {
            JOptionPane.showMessageDialog(null, "输入异常");
        }
        System.out.println("main end...");
    }
}
